package com.liu.mapper;

import com.liu.proxyDemo.User;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;


public class UserMapperImpl implements UserMapper{


    //之前我们的所有操作都使用sqlsession来操作，现在使用sqlsessionTemplate
    public SqlSession sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession = sqlSession;
    }

    public UserMapperImpl() {
    }


    public List<User> selectUser() {
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

        return userMapper.selectUser();
    }

    public int addUser(User user) {
        return 0;
    }

    public int deleteUser(Integer id) {
        return 0;
    }
}
